import httpUtils from "@/core/utils/http.utils";
// service path
const urls = {
    'getSysUserPage': `/api/upms/sysUser/page`,
    'getSysUserById': `/api/upms/sysUser/`,
    'saveSysUser': `/api/upms/sysUser`,
    'updateSysUserById': `/api/upms/sysUser`,
    'deleteSysUserById': `/api/upms/sysUser/`,
    //'getSysRoleList': `/api/upms/sysRole/list`,
    //'getSysOrgTree': `/api/upms/sysOrg/tree`,
    // 不记录日志
    'getSysRoleList': `/api/upms/sysRole/listNoLog`,
    'getSysOrgTree': `/api/upms/sysOrg/treeNoLog`,
    'deblockingUser': `/api/upms/sysUser/deblocking/`,
    'getSafePolicy': `/api/upms/sysDictItem/getSafePolicy`, // 获取安全策略,
    'personDetail': `/api/upms/sysUser/personDetail/`,
    'enable': `/api/upms/sysUser/enable`,
    'resetPwd': `/api/upms/sysUser/resetPwd`,
};
// service methods
const sysUserApi = {
    getSysUserPage (param) {
        return httpUtils.getEncrypt(urls.getSysUserPage, param);
    },
    getSysUserById(id) {
        return httpUtils.get(urls.getSysUserById + id, {});
    },
    saveSysUser(param) {
        return httpUtils.postEncrypt(urls.saveSysUser, param);
    },
    updateSysUserById(params) {
        return httpUtils.putEncrypt(urls.updateSysUserById, params);
    },
    deleteSysUser(id) {
        return httpUtils.delete(urls.deleteSysUserById + id);
    },
    getSysRoleList () {
        return httpUtils.get(urls.getSysRoleList, {});
    },
    getSysOrgTree () {
        return httpUtils.getEncrypt(urls.getSysOrgTree);
    },
    deblockingUser(id){
        return httpUtils.get(urls.deblockingUser + id, {});
    },
    getSafePolicy(params){
        return httpUtils.getEncrypt(urls.getSafePolicy, params);
    },
    personDetail(card){
        return httpUtils.get(urls.personDetail + card, {});
    },
    enable(params) {
        return httpUtils.putEncrypt(urls.enable, params);
    },
    resetPwd(params) {
        return httpUtils.putEncrypt(urls.resetPwd, params);
    },
};

export default sysUserApi;
